setForegroundServiceBehavior
Specify a desired visibility policy for a Notification associated with a foreground service. The default value is FOREGROUND_SERVICE_DEFAULT, meaning the system can choose to defer visibility of the notification for a short time after the service is started. Pass FOREGROUND_SERVICE_IMMEDIATE to this method in order to guarantee that visibility is never deferred. Pass FOREGROUND_SERVICE_DEFERRED to request that visibility is deferred whenever possible.
Note that deferred visibility is not guaranteed. There may be some circumstances under which the system will show the foreground service's associated Notification immediately even when the app has used this method to explicitly request deferred display.
This method has no effect when running on versions prior to S.